package com.cityp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cityp.bean.Question;
import com.cityp.bean.ResultBean;
import com.cityp.mapper.questionMapper;
import com.cityp.service.questionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class questionServiceImpl extends ServiceImpl<questionMapper,Question> implements questionService  {
    @Autowired
    private questionMapper questionMapper;

    @Override
    public List<Question> get(int sum,int num) {
        return questionMapper.get(sum-num,num);
    }

    @Override
    public int insertOne(Question question) {
        return questionMapper.insert(question);
    }

    public int delete(List<Integer> qid){
        return questionMapper.deleteBatchIds(qid);
    }

    public int deleteOne(int qid){
        return questionMapper.deleteById(qid);
    }

    public List<Question> selectByType(int tid,int offset,int rows){
        return questionMapper.selectByType(tid,offset,rows);
    }

    public List<Question> findAll(){
        return questionMapper.findAll();
    }

}
